/*************************************************
Author: tony
Date: 03/04/2013
Description:
Notes: 
*************************************************/

#ifndef __cmdgift_h__
#define __cmdgift_h__

#include "../maindef.h"
#include "commclass.h"
#include "PBMsgHead.pb.h"
#include "MsgGift.pb.h"

class CMainCtrl;

class CCmdOnlineGift : public CTAsyncCmd
{
public:	
    virtual int Do(void* pData);
    virtual int AnsClients(int iRet);
    virtual int LogicDo(int iRet);

    int GetGiftAvailTime (int iGiftTime, int iTotalOnlinTime, int iHaveGotGiftCnt);

    CMainCtrl* pstMainCtrl;
    PBMsgHead  stMsgHead;
    CEnpNetHead stEnpHead;

    MsgReqOnlineGiftOpt stReq;
    MsgAnsOnlineGiftOpt stAns;

    unsigned int _uiGID;
};


class CCmdGiftOpt : public CTAsyncCmd
{
public:	
    virtual int Do(void* pData);
    virtual int AnsClients(int iRet);
    virtual int LogicDo(int iRet);

    int FetchBonus (CPlayerBaseInfo & stPlayerBaseInfo, CPlayerDetailInfo & stPlayerDetailInfo, CPlayerOnlineData & stPlayerOnlineData, CDropItem & stGiftItem);

    CMainCtrl* pstMainCtrl;
    PBMsgHead  stMsgHead;
    CEnpNetHead stEnpHead;

    MsgReqGiftOpt stReq;
    MsgAnsGiftOpt stAns;

    bool bNeedSaveBase;
    bool bNeedSaveDetail;
    unsigned int _uiGID;
};


#endif // __cmdgift_h__


